/**
	This file is part of Fighting Field.

    Fighting Field is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Fighting Field is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Fighting Field.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef FF_PARAMSPANEL_H
#define FF_PARAMSPANEL_H

#include "Prerequisites.h"

#include "Widget.h"

namespace FF
{
	class ParamsPanel : public Widget
	{
	public:
		struct Style
		{
			Ogre::String templateName;
		};
		
	public:
		// Do not instantiate any widgets directly. Use GuiManager.
		ParamsPanel(const Ogre::String& name, const Style& style, Ogre::Real width, unsigned int lines);

		void SetAllParamNames(const Ogre::StringVector& paramNames);
		const Ogre::StringVector& GetAllParamNames();
		
		const Style& GetStyle() const { return mStyle; }

		void SetAllParamValues(const Ogre::StringVector& paramValues);
		void SetParamValue(const Ogre::DisplayString& paramName, const Ogre::DisplayString& paramValue);
		void SetParamValue(unsigned int index, const Ogre::DisplayString& paramValue);
		Ogre::DisplayString GetParamValue(const Ogre::DisplayString& paramName);
		Ogre::DisplayString GetParamValue(unsigned int index);
		const Ogre::StringVector& GetAllParamValues();

	protected:
		// Internal method - updates text areas based on name and value lists.
		void UpdateText();

	protected:
		Style mStyle;
		Ogre::TextAreaOverlayElement* mNamesArea;
		Ogre::TextAreaOverlayElement* mValuesArea;
		Ogre::StringVector mNames;
		Ogre::StringVector mValues;
	};
}

#endif